package com.miaosha.service;

import com.miaosha.error.ErrorException;
import com.miaosha.model.ProductModel;

import java.util.List;

public interface ProductService {
    // 创建商品
    ProductModel createProduct(ProductModel productModel) throws ErrorException;

    // 商品列表浏览
    List<ProductModel> getProductList();


    // 商品详情浏览
    ProductModel getProductDetailById(Integer productId) throws ErrorException;

    // 库存扣减
    boolean decreaseStock(Integer productId, Integer amount) throws ErrorException;

    // 商品销量增加
    void increaseSales(Integer productId, Integer amount) throws ErrorException;
}
